#!/bin/bash
set -e
set +o noglob
DIR="$(cd "$(dirname "$0")" && pwd)"
source $DIR/common.sh

item=0
h2 "[Step $item]: ADD yum.repo.d for kubernetes.repo ..."; let item+=1
cat > /etc/yum.repos.d/kubernetes.repo << EOF
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
h2 "[Step $item]: install kubeadm、kubelet、kubectl ..."; let item+=1
yum install -y kubelet-1.28.0 kubeadm-1.28.0 kubectl-1.28.0
h2 "[Step $item]: enable kubectl ..."; let item+=1
systemctl enable kubelet

